@extends('layouts.app')
@section('content')
    <div class="container">
        <div class="row">
            <div class="col">
                <div class="card">
                    <div class="card-body">
                        @foreach($directories as $file)
                            <a href="{{route('files.index',['folder'=>"$file"])}}" class="d-inline-block file-box">
                                <img class="file-cover-box" src="{{asset('storage/icon_folder.png')}}"/>
                                <h5 class="file-title text-center multi-line-1">{{$file}}</h5>
                            </a>
                        @endforeach
                        @foreach($files as $file)
                                <a target="_blank" href="{{route('files.download',['path'=>$file])}}" class="d-inline-block file-box">
                                    <img class="file-cover-box" src="{{asset("storage/$file")}}"/>
                                    <h5 class="file-title text-center multi-line-1">{{$file}}</h5>
                                </a>
                        @endforeach
                    </div>
                    <form class="card-body" action="{{route('files.store')}}" method="post"
                          enctype="multipart/form-data">
                        {{csrf_field()}}

                        <div class="form-group">
                            <label for="image">图片:</label>
                            <input class="form-control" type="file" name="image" id="image">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary" type="submit">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
